<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>hello vue</title>
<style type="text/css">

</style>
</head>
<body>


<ol>
	<h3>Vue提供的标签</h3>
	<li>component</li>
	<li>template</li>
	<li>transition</li>
	<li>transitionGroup</li>
</ol>




<div id="app">

	<a href="#" @click.prevent= " comName='login' " >登录</a>
	<a href="#" @click.prevent= " comName='register' " >注册</a>
	<a href="#" @click.prevent= " comName='three' " >第三个组件</a>
  
 <!-- component为Vue提供的用来展示对应名称的组件 -->
 <!-- cpmponent 是一个占位符，：is指令可以用来指定要展示的组件名称 -->
	<component :is=" comName "></component>


</div>









<br>
<script src="vue.js"></script>

<script type="text/javascript">

Vue.component('login',{
	template:'<h3>登录组件</h3>'
})


Vue.component('register',{
	template:'<h3>注册组件</h3>'
})

Vue.component('three',{
	template:'<h3>第三个组件</h3>'
})





var app = new Vue({
  el: '#app',

  data: {
  	comName:'login' //代表component绑定的组件名称，方便切换组件
  },

  methods:{

  }

})





</script>

	
</body>
</html>